﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace FoundationLib.Ifc.Exceptions
{
	/// <summary>
	/// This class represents a data access exception.
	/// </summary>
	[Serializable]
	public class DataAccessException : TechnicalException
	{
		/// <summary>
		/// Creates a new <see cref="DataAccessException"/>.
		/// </summary>
		public DataAccessException()
			: base()
		{
		}

		/// <summary>
		/// Creates a new <see cref="DataAccessException"/>.
		/// </summary>
		/// <param name="message">The exception message</param>
		public DataAccessException(string message)
			: base(message)
		{
		}

		/// <summary>
		/// Creates a new <see cref="DataAccessException"/>.
		/// </summary>
		/// <param name="message">The exception message</param>
		/// <param name="parameters">The parameters to replace</param>
		public DataAccessException(string message, params object[] parameters)
			: base(String.Format(message, parameters))
		{
		}

		/// <summary>
		/// Creates a new <see cref="DataAccessException"/>.
		/// </summary>
		/// <param name="message">The exception message</param>
		/// <param name="innerException">The inner exception</param>
		/// <param name="parameters">The parameters to replace in the exception message</param>
		public DataAccessException(string message, Exception innerException, params object[] parameters)
			: base(String.Format(message, parameters), innerException)
		{
		}

		/// <summary>
		/// Creates a new <see cref="DataAccessException"/>.
		/// </summary>
		/// <param name="message">The exception message</param>
		/// <param name="innerException">The inner exception</param>
		public DataAccessException(string message, Exception innerException)
			: base(message, innerException)
		{
		}

		/// <summary>
		/// Creates a new <see cref="DataAccessException"/>.
		/// </summary>
		/// <param name="context">The streaming context</param>
		/// <param name="info">The serialisation information</param>
		protected DataAccessException(SerializationInfo info, StreamingContext context)
			: base(info, context)
		{
		}
	}
}
